<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
	<ul class="nav nav-tabs">
		<li><a href="{:url('student/index')}">所有学生</a></li>
		<li class="active"><a href="{:url('student/add')}">添加学生</a></li>
	</ul>
	<form class="form-horizontal js-ajax-form margin-top-20" action="{:url('student/addPost')}" method="post">
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">头像:</label>
			<div class="col-md-6 col-sm-10">
				<input id="photo-1" type="hidden" name="image" >
				<input id="photo-1-name" type="text" name="photo_name" title="图片名称">
				<a href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a>
			</div>
		</div>
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">预览:</label>
			<div class="col-md-6 col-sm-10">
				<img id="photo-1-preview" width="100px" height="80px">
			</div>
		</div>
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">姓名:</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="input-name" name="name">
			</div>
		</div>
		.<div class="form-group">
		<label for="input-name" class="col-sm-2 control-label">性别:</label>
		<div class="col-md-6 col-sm-10">
			<input type="radio" name="sex" value="0" checked="true" />男
			<input type="radio" name="sex" value="1" />女
		</div>
	</div>

		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">身份证号:</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="input-name" name="idcard">
			</div>
		</div>
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">年龄:</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="input-name" name="age">
			</div>
		</div>
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">家庭住址:</label>
			<div class="col-md-6 col-sm-10">
				<input type="text" class="form-control" id="input-name" name="address">
			</div>
		</div>
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">所属学校:</label>
			<div class="col-md-6 col-sm-10">
				<select name="school_id" id="selectSchool" lay-filter="selectSchool" style="width:100%">
					<option value="">--请选择学校--</option>
					<foreach name="school" item="vo">
						<option value="{$vo.id}">{$vo.name}</option>
					</foreach>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label for="input-name" class="col-sm-2 control-label">所属班级:</label>
			<div class="col-md-6 col-sm-10">
				<select name="Class_id" id="selectClass" class="valid"  style="width:100%">
					<option value="">--请选择班级--</option>
				</select>
		</div>
</div>

		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
				<a class="btn btn-default" href="{:url('admin/student/index')}">{:lang('BACK')}</a>
			</div>
		</div>
	</form>
</div>
<script src="__STATIC__/js/admin.js"></script>

<script>
	$(function () {
		$('#selectSchool').change('click',function () {
			var shcoolId=$('#selectSchool').val();
			$.ajax({
				url:"{:url('student/getClass')}",
				type:"POST",
				data: {schoolId:shcoolId},
				success:function (res) {
					$('#selectClass').html(res);
                }
			});
        });
    })
</script>
</body>
</html>